import { request } from '@/utils/request';
/**
 * 公告分页列表
 * @param pageNum 页码
 * @param pageSize 页码
 * @param data 查询参数
 * @returns 
 */
export function getPageList(pageNum: number = 1, pageSize: number = 10, params: any = {}) {
    return request({
        url: 'rcbg/proclamationInfo/pageList',
        method: 'get',
        params: {
            pageNum,
            pageSize,
            ...params
        }
    }, {
        isGetDataDirectly: true
    });
}

/**
 * 保存公告
 * @param data 
 * @returns 
 */
export function save(data: any) {
    return request({
        url: 'rcbg/proclamationInfo/save',
        method: 'post',
        data
    }, {
        isGetDataDirectly: false
    });
}

export function modify(data: any) {
    return request({
        url: 'rcbg/proclamationInfo/modify',
        method: 'post',
        data
    }, {
        isGetDataDirectly: false
    });
}

/**
 * 删除公告
 * @param id 主键
 * @returns 
 */
export function remove(id: string) {
    return request({
        url: 'rcbg/proclamationInfo/delete/' + id,
        method: 'get'
    }, {
        isGetDataDirectly: false
    });
}

export function getByIdWithAttachment(id) { 
    return request({
        url: 'rcbg/proclamationInfo/getByIdWithAttachment/' + id,
        method: 'get'
    }, {
        isGetDataDirectly: true
    });
}